package objects2;

import java.io.*;

public class Test1 {
    public static void main(String[] args) {
        User u = new User("zhangjd", "666zjd","张家动" ,18);
        try(
                ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream("C:/Users/zjd/IdeaProjects/java/src/itheima.11.txt"));
                ) {
            oos.writeObject(u);
            System.out.println(" 程序列化对象成功 ");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}
